package com.centriole.common.entity;

import java.util.Date;
import java.util.List;

/**
 *  功   能： 对外使用的 用户 实体类
 *      "Ex"前缀表示对外使用的用户实体,还有个"Paas"前缀表示 PAAS平台内部使用的用户实体
 *  创建人：陈默晗
 *  时   间：2018年4月10日上午9:55:48
 */
public class ExUser extends BaseEntity {

    /**
     `userId` char(32)   'UUID主键',
     `accountName` '用户账号',
     `password` '必须是存MD5加密以后的密文',
     `nickName`  '用户名',
     `status`  '账号状态-> 1:已启用；2:已停用',
     `lastLogin`  '最后登录时间，注册后的最后登录时间为注册时间',
     */
    private String userId;
    private String accountName;
    private String password;
    private String nickName;
    private Integer status;
    private Date lastLogin;
    private List<ExRole> roles;
    private List<ExPermission> permissions;

    /* 表示该用户当前账号状态为 可用*/
    public final static int IS_ACTIVED = 1;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getLastLogin() {
        return lastLogin;
    }

    public void setLastLogin(Date lastLogin) {
        this.lastLogin = lastLogin;
    }

    public List<ExRole> getRoles() {
        return roles;
    }

    public void setRoles(List<ExRole> roles) {
        this.roles = roles;
    }

    public List<ExPermission> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<ExPermission> permissions) {
        this.permissions = permissions;
    }

    @Override
    public String toString() {
        return "ExUser{" +
                "userId='" + userId + '\'' +
                ", accountName='" + accountName + '\'' +
                ", password='" + password + '\'' +
                ", nickName='" + nickName + '\'' +
                ", status=" + status + '\'' +
                ", createTime=" + getCreateTime() + '\'' +
                ", modifyTime=" + getModifyTime() +
                '}';
    }
}
